#include "stm32f10x.h"                  // Device header
#include "OLED.h"
#include "Encoder.h"
#include "Delay.h"
#include "LED.h"

int16_t Num;

int main(void)
{
	OLED_Init();
	Encoder_Init();
	LED_Init();
	OLED_ShowString(1,1,"Num:");
	while(1)
	{
		Num += Encoder_Count_Get();
		OLED_ShowSignedNum(2,5,Num,6);
		if (Num > 100)
		{
			LED1_ON();
			OLED_ShowString(3,1,"TOO HIGH!");
		}
		else
		{
			LED1_OFF();
			OLED_ShowString(3,1,"NORMAL   ");
		}
	}
}
